﻿var ajaxsetting = {
    template: "<div class='progressbar'>数据加载中，请稍等...</div>"
};
var ajaxManager = function () {
    this.load = function (jo, option  ) {
        var reqobj = {};
        if (typeof option.data == "string" || !option.data.postdata) {
            reqobj.url = option.data;
            reqobj.type = "GET";
        } else {
            reqobj.url = option.data.url;
            reqobj.data = option.data.postdata;
            reqobj.type = "POST";
        }
        if (option.dataType) {
            reqobj.dataType = option.dataType;
        }
        reqobj.onsuccess = function(response) {
            jo.html(response);
        };
        if (option.loading) {
            jo.html(option.loading);
        }
        $.ajax(reqobj);
    };
};
var mAjaxManager = new ajaxManager();